package nl.stroep.utils 
{
	import flash.display.Sprite;
	import flash.text.TextField;
	/**
	 * ...
	 * @author Mark Knol
	 */
	public class Logger extends Sprite
	{
		private var output:TextField;
		
		public function Logger() 
		{
			
		}
		
		public function log(...msg:Array):void
		{
			if (!output) 
			{
				addChild(output = new TextField());
				output.width = 400;
				output.height = 600;
				output.multiline = output.selectable = true;
				output.text = " ***** Entering *****\n"
				output.wordWrap = true;
			}
			output.appendText(msg.join(",") + "\n")
		}
		
		public static function getObject(result:*):String
		{
			var r:String = ""
			for (var resultItem:* in result)
			{				
				r += "\n\t" + resultItem.toString() + ":" +  result[resultItem];
				
			}
			return r;
		}
	}

}